1. Field of the Invention
The present invention relates to a numerical controller for controlling a multi-axis machining device, which machines a workpiece mounted on a table by using at least three linear axes and at least one rotary axis, wherein a direction of a tool with respect to the workpiece is relatively changed.
2. Description of the Related Art
Japanese Patent Application Laid-Open No. 2003-195917 (corresponding to U.S. Pat. No. 6,775,586) describes a technique for (1) instructing, in a machine having a rotary table, a path of a tool center point with linear axes on a coordinate system (hereinafter referred to as table coordinate system) rotating together with the table, (2) interpolating the instructed path of the tool center point based on a speed instruction so as to obtain “interpolated positional information of the path of the tool center point”, and further, interpolating moving instructions of a rotary axis so as to obtain “interpolated positional information of the rotary axis”, (3) correcting “the interpolated positional information of the linear axes” based on the obtained “interpolated positional information of the rotary axis”, and (4) driving a servo of each corresponding axis based on the corrected “interpolated positional information of the linear axes” and the “interpolated positional information of the rotary axis”.
FIG. 1 illustrates an example of a machine in which a table is rotated with two rotary axes (A axis and B axis), and a tool head is moved by three linear axes (X axis, Y axis, Z axis).
A speed is instructed, a path of a tool center point is instructed on a table coordinate system, and moving instructions to a rotary axis is instructed. In FIG. 1, the table coordinate system on the start point of the path of the tool center point is indicated as X1 and Y1, while the table coordinate system at an end point of the path of the tool center point is indicated as X2 and Y2. FIG. 1 illustrates a state in which only the A axis of the rotary axis is moved. The origin of the table coordinate system is defined as a cross point of the rotation center of the A axis and the rotation center of the B axis.
FIG. 2 is a view for describing the path of the tool center point on the table coordinate system.
In FIG. 2, the position of the start point of the path of the tool center point is indicated as (Xs, Ys, Zs), while the position of the end point of the path of the tool center point is indicated as (Xe, Ye, Ze). The path of the tool center point is interpolated on the table coordinate system based on the speed instruction, whereby “interpolated positional information of the path of the tool center point” is obtained as the position of the tool center point on the table coordinate system. The moving instruction for the rotary axis is interpolated such that the interpolation is started together with the start of the interpolation of the path of the tool center point, and the interpolation is ended together with the end of the interpolation of the path of the tool center point, whereby “interpolated positional information of the rotary axis” is obtained.
The “interpolated positional information of the path of the tool center point” is corrected by the “interpolated positional information of the rotary axis” to become a position of a tool control point. The position of the tool control point is apart from the position of the tool center point by a distance corresponding to a tool length compensation vector. A servo for each axis is driven according to the position of the tool control point (i.e., according to the compensated interpolated positional information of the linear axis and the interpolated positional information of the rotary axis). This technique is referred to as a “table-rotating-type tool-center-point control”.
Japanese Patent Application Laid-Open No. 6-332524 (corresponding to U.S. Pat. No. 5,545,959) describes a technique for (1) obtaining a distributed movement amount AU for every predetermined cycle on each linear moving axis in case where a linear interpolation is carried out only with the linear moving axis, and (2) calculating a distributed movement amount for every predetermined cycle for each rotary axis that changes an angle of a tool, in association with a number of times of the interpolation, (3) thereby moving the tip end of the tool with the instructed moving speed when machining is done with the tool whose angle with respect to a workpiece is changed. In other words, according to this technique, (1) a path of a tool center point for a linear axis is instructed, in a machine having a rotary tool head, on a coordinate system (more specifically, a machine coordinate system) that does not rotate, (2) the instructed path of the tool center point is interpolated based on a speed instruction so as to obtain “interpolated positional information of the path of the tool center point”, and the moving instruction of the rotary axis is interpolated so as to obtain “interpolated positional information of the rotary axis”, whereby (3) the “interpolated positional information of the linear axis” is corrected based on the obtained “interpolated positional information of the rotary axis”, and (4) a servo of each corresponding axis is driven based on the corrected “interpolated positional information of the linear axis” and the “interpolated positional information of the rotary axis”.
FIG. 3 illustrates one example of a machine in which a tool head rotates with two rotary axes (A axis and C axis).
In FIG. 3, a path of a tool center point, in addition to an instructed speed, is instructed, and the movement for the rotary axis is instructed. The position of the start point of the path of the tool center point is indicated as (Xs, Ys, Zs), while the position of the end point of the path of the tool center point is indicated as (Xe, Ye, Ze).
The path of the tool center point is interpolated based on the speed instruction, whereby interpolated positional information of the path of the tool center point is obtained as the position of the tool center point. The moving instruction for the rotary axis is interpolated such that the interpolation is started together with the start of the interpolation of the path of the tool center point, and the interpolation is ended together with the end of the interpolation of the path of the tool center point, whereby “interpolated positional information of the rotary axis” is obtained. The interpolated positional information of the path of the tool center point is corrected by the interpolated positional information of the rotary axis to become a position of a tool control point. The position of the tool control point is defined as a cross point of the rotation center of the A axis and the rotation center of the C axis. The position of the tool control point is apart from the position of the tool center point by a distance corresponding to a tool length compensation vector. A servo for each axis is driven according to the position of the tool control point, i.e., according to the corrected interpolated positional information of the linear axes and the interpolated positional information of the rotary axis. This technique is referred to as a “tool-head-rotating-type tool-center-point control”.
The “table-rotating-type tool-center-point control”, the “tool-head-rotating-type tool-center-point control”, and a “tool-center-point control in a later-described mixed-type machining device (a machining device in which both a table and a tool head rotate)” are collectively referred to as “tool-center-point control”.
It has been described here that the “table-rotating-type tool-center-point control” is applied to the machine having two rotary axes that are the A axis and the B axis. However, this control may be applied to a machine having two rotary axes that are an A axis and a C axis, or a machine having two rotary axes that are a B axis and a C axis. This control may also be applied to a machine having only one rotary axis. Similarly, it has been described here that the “tool-head-rotating-type tool-center-point control” is applied to the machine having two rotary axes that are the A axis and the C axis. However, this control may be applied to a machine having two rotary axes that are an A axis and a B axis, or a machine having two rotary axes that are a B axis and a C axis. This control may also be applied to a machine having only one rotary axis. The same is applied to the tool-center-point control in the mixed-type machining device. A numerical controller according to the present invention is applicable to a control of machines having various configurations described above.
The technique of the speed control described in the above-mentioned Patent Document will be described.
The length Dp of the conventional path of the tool center point in an instruction block is obtained from an equation (1) described below. In the table-rotating-type tool-center-point control, the length Dp of the path of the tool center point is the length of the path of the tool center point on the table coordinate system.Dp=√{square root over ((Xe−Xs)2+(Ye−Ys)2+(Ze−Zs)2)}{square root over ((Xe−Xs)2+(Ye−Ys)2+(Ze−Zs)2)}{square root over ((Xe−Xs)2+(Ye−Ys)2+(Ze−Zs)2)}  (1)
Since the length Dp of the path of the tool center point is interpolated based on the speed instruction F, a time T taken for the interpolation of the path of the tool center point is obtained by an equation (2) described below.
                    T        =                  Dp          F                                    (        2        )            
The rotary axis is interpolated with the time T, so that a speed Fa of the corresponding rotary axis A axis, a speed Fb of the B axis or a speed Fc of the C axis is expressed by an equation (3) described below. In the equation (3), As, Bs, and Cs are instruction positions on the A axis, B axis and C axis, respectively, at the start point of the path of the tool center point, while Ae, Be, and Ce are instruction positions on the A axis, B axis, and C axis at the end point of the path of the tool center point.
                                                                        Fa                =                                                                                                Ae                      -                      As                                                                            T                                                                                                        Fb                =                                                                                                Be                      -                      Bs                                                                            T                                                                                                        Fc                =                                                                                                Ce                      -                      Cs                                                                            T                                                                    }                            (        3        )            
The operations illustrated in FIGS. 1 and 3 are based on the instruction described in a Program Example 1 described below.